#ifndef MAP_H
#define MAP_H

#include <vector>
#include <string>

class Tile;

// The map that contains a two dimensional vector of tiles.
// The map can be used for quick acces of the objects in the game.
class Map
{
public:
	typedef std::vector<Tile*> Row;
	typedef std::vector<Row> Tiles;

	Map();
	~Map();

	void clear();

	bool loadFile(const char* filename, const std::string& playerName1, const std::string& playerName2);
    
	void draw() const;

	unsigned int getWidth() const {return width;}
	unsigned int getHeight() const {return height;}

	// Function to see if coordinates are in the map.
	bool isWithinBounds(unsigned int xDesired, unsigned int yDesired) const;

	// Operator to acces the different rows in the map.
	const Row& operator[] (unsigned int i);
	const Row& operator[] (unsigned int i) const;

private:
	Tiles tiles; // All objects added to the map will be deleted when dungeon is destroyed.

	unsigned int width;
	unsigned int height;
};

#endif